package cn.itcast.bos.repository;

import cn.itcast.bos.domain.base.FixedArea;
import cn.itcast.bos.domain.take_delivery.Promotion;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;

/**
 * Created by Think on 2017/9/24.
 */
public interface PromotionRepository  extends JpaRepository<Promotion,Integer>,JpaSpecificationExecutor<Promotion> {
    @Query(value="update Promotion set status = '2' where endDate < ? and status = '1'")
    @Modifying
    void updateStatus(Date date);
}
